<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Snake: Snake luokkareferenssi</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generoinut Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Snake</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Pääsivu</span></a></li>
      <li><a href="namespaces.html"><span>Nimiavaruudet</span></a></li>
      <li class="current"><a href="annotated.html"><span>Luokat</span></a></li>
      <li><a href="files.html"><span>Tiedostot</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Luokkalista</span></a></li>
      <li><a href="classes.html"><span>Luokkaluettelo</span></a></li>
      <li><a href="functions.html"><span>Luokan&#160;jäsenet</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('class_snake.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Julkiset jäsenfunktiot</a> &#124;
<a href="#pri-attribs">Yksityiset attribuutit</a>  </div>
  <div class="headertitle">
<div class="title">Snake luokkareferenssi</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Snake" -->
<p><code>#include &lt;<a class="el" href="snake_8h_source.html">snake.h</a>&gt;</code></p>

<p><a href="class_snake-members.html">Lista kaikista jäsenistä.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Julkiset jäsenfunktiot</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a32b3531dd5974b8d157fcbb84b490e52">Snake</a> (int x, int y)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a941fbaad96ee33ca3a7c30c28ca44ef8">~Snake</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a70633b60e38c1b03358e9292a32fa3c7">move</a> (int x, int y)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a8251b1fc68c632af86eef620256aec1f">collision</a> (<a class="el" href="class_block.html">Block</a> *block)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a24aeabf4615c0d8d91edf95ecfbd5c60">addLength</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#af79498343f5f511cfb86dbe7048a1f85">outsideRectangle</a> (int x1, int y1, int x2, int y2)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#ab1814935ff835fbe3ce11de75012db8a">collisionWithItself</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a7aee0ab8b45446d0736423b51fd077da">getX</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#aa7bb36db425d5588349de8a8d5b278cf">getY</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#aa34f490538ed582a33c9aded6c226a7f">setDirection</a> (int dir)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#af6d4987dc204b4f9612dd3431d2cb0f2">getDirection</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#adac9182b065f945a8ea1114a3d03e284">draw</a> (HDC hdc, int x, int y)</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Yksityiset attribuutit</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a1349ccf7f145382b601ac41927f84af4">direction</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#aba2f9d9cbf10b4be4887e5bc9612bfde">length</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_block.html">Block</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a9b1b4e890de54b0fe8fdff0e9f641612">blocks</a> [100]</td></tr>
</table>
<hr/><h2>Rakentajien &amp; purkajien dokumentaatio</h2>
<a class="anchor" id="a32b3531dd5974b8d157fcbb84b490e52"></a><!-- doxytag: member="Snake::Snake" ref="a32b3531dd5974b8d157fcbb84b490e52" args="(int x, int y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Snake::Snake </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Muodostinfunktio. Asettaa aloitussijainnin. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>x-koordinaatti </td></tr>
    <tr><td class="paramname">y</td><td>y-koordinaatti </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a941fbaad96ee33ca3a7c30c28ca44ef8"></a><!-- doxytag: member="Snake::~Snake" ref="a941fbaad96ee33ca3a7c30c28ca44ef8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Snake::~Snake </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tuhoaja. </p>

</div>
</div>
<hr/><h2>Jäsenfunktioiden dokumentaatio</h2>
<a class="anchor" id="a24aeabf4615c0d8d91edf95ecfbd5c60"></a><!-- doxytag: member="Snake::addLength" ref="a24aeabf4615c0d8d91edf95ecfbd5c60" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Snake::addLength </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Lisää palikkajonon pituutta yhdellä. </p>

</div>
</div>
<a class="anchor" id="a8251b1fc68c632af86eef620256aec1f"></a><!-- doxytag: member="Snake::collision" ref="a8251b1fc68c632af86eef620256aec1f" args="(Block *block)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Snake::collision </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_block.html">Block</a> *&#160;</td>
          <td class="paramname"><em>block</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tarkistaa, törmääkö madon ensimmäinen palikka annetun palikan kanssa. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">block</td><td>testattava palikka </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>tapahtuiko törmäystä </dd></dl>

</div>
</div>
<a class="anchor" id="ab1814935ff835fbe3ce11de75012db8a"></a><!-- doxytag: member="Snake::collisionWithItself" ref="ab1814935ff835fbe3ce11de75012db8a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Snake::collisionWithItself </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Törmääkö ensimmäinen palikka muiden palikoiden kanssa. </p>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>totuusarvo </dd></dl>

</div>
</div>
<a class="anchor" id="adac9182b065f945a8ea1114a3d03e284"></a><!-- doxytag: member="Snake::draw" ref="adac9182b065f945a8ea1114a3d03e284" args="(HDC hdc, int x, int y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Snake::draw </td>
          <td>(</td>
          <td class="paramtype">HDC&#160;</td>
          <td class="paramname"><em>hdc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Piirtää kaikki palikat suorakulmion sisään, jonka vasen yläkulma on annetuissa koordinaateissa. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">hdc</td><td>kahva piirrettävään kohteeseen </td></tr>
    <tr><td class="paramname">x</td><td>origon x </td></tr>
    <tr><td class="paramname">x</td><td>origon y </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af6d4987dc204b4f9612dd3431d2cb0f2"></a><!-- doxytag: member="Snake::getDirection" ref="af6d4987dc204b4f9612dd3431d2cb0f2" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Snake::getDirection </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Palauttaa suunnan. </p>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>direction-jäsenmuuttujan arvo </dd></dl>

</div>
</div>
<a class="anchor" id="a7aee0ab8b45446d0736423b51fd077da"></a><!-- doxytag: member="Snake::getX" ref="a7aee0ab8b45446d0736423b51fd077da" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Snake::getX </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Palauttaa ensimmäisen palikan x-koordinaatin </p>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>palikan x </dd></dl>

</div>
</div>
<a class="anchor" id="aa7bb36db425d5588349de8a8d5b278cf"></a><!-- doxytag: member="Snake::getY" ref="aa7bb36db425d5588349de8a8d5b278cf" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Snake::getY </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Palauttaa ensimmäisen palikan y-koordinaatin </p>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>palikan y </dd></dl>

</div>
</div>
<a class="anchor" id="a70633b60e38c1b03358e9292a32fa3c7"></a><!-- doxytag: member="Snake::move" ref="a70633b60e38c1b03358e9292a32fa3c7" args="(int x, int y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Snake::move </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Siirtää matoa suhteessa entiseen sijaintiin. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>suhteellinen x-koordinaatti </td></tr>
    <tr><td class="paramname">y</td><td>suhteellinen y-koordinaatti </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af79498343f5f511cfb86dbe7048a1f85"></a><!-- doxytag: member="Snake::outsideRectangle" ref="af79498343f5f511cfb86dbe7048a1f85" args="(int x1, int y1, int x2, int y2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Snake::outsideRectangle </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tarkistaako, onko ensimmäinen palikka annetun suorakulmion ulkopuolella. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x1</td><td>suorakulmion vasemman yläkulman x-koordinaatti </td></tr>
    <tr><td class="paramname">y1</td><td>suorakulmion vasemman yläkulman y-koordinaatti </td></tr>
    <tr><td class="paramname">x2</td><td>suorakulmion oikean alakulman x-koordinaatti </td></tr>
    <tr><td class="paramname">y2</td><td>suorakulmion oikean alakulman y-koordinaatti </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>totuusarvo </dd></dl>

</div>
</div>
<a class="anchor" id="aa34f490538ed582a33c9aded6c226a7f"></a><!-- doxytag: member="Snake::setDirection" ref="aa34f490538ed582a33c9aded6c226a7f" args="(int dir)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Snake::setDirection </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dir</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Asettaa suunnan. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">dir</td><td>uusi suunta </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Jäsendatan dokumentaatio</h2>
<a class="anchor" id="a9b1b4e890de54b0fe8fdff0e9f641612"></a><!-- doxytag: member="Snake::blocks" ref="a9b1b4e890de54b0fe8fdff0e9f641612" args="[100]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_block.html">Block</a>* <a class="el" href="class_snake.html#a9b1b4e890de54b0fe8fdff0e9f641612">Snake::blocks</a>[100]<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a1349ccf7f145382b601ac41927f84af4"></a><!-- doxytag: member="Snake::direction" ref="a1349ccf7f145382b601ac41927f84af4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_snake.html#a1349ccf7f145382b601ac41927f84af4">Snake::direction</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="aba2f9d9cbf10b4be4887e5bc9612bfde"></a><!-- doxytag: member="Snake::length" ref="aba2f9d9cbf10b4be4887e5bc9612bfde" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_snake.html#aba2f9d9cbf10b4be4887e5bc9612bfde">Snake::length</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/>Dokumentaatio tälle luokalle luotiin seuraavista tiedostoista:<ul>
<li>C:/Documents and Settings/HP_Omistaja/Työpöytä/windowsPeli/winPeliSVN/winPeli/<a class="el" href="snake_8h_source.html">snake.h</a></li>
<li>C:/Documents and Settings/HP_Omistaja/Työpöytä/windowsPeli/winPeliSVN/winPeli/<a class="el" href="snake_8cpp.html">snake.cpp</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="class_snake.html">Snake</a>      </li>
      <li class="footer">Generoinut projektille Snake Sat Apr 16 2011 19:06:21 &#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
    </ul>
  </div>

</body>
</html>
